function Cross_entrophy = cal_CR(data,num_bins)
    % 初始化JM_average数组为空
    Cross_entrophy = [];
    % 获取data_train的列数
    num_columns = size(data, 2);
    % 获取唯一的标签种类及其索引
    [unique_labels, ~, ic] = unique(data(:,1));
    % 区间数量
    % 从第二列开始遍历data_train的每一列
    for i = 2:num_columns
        % 找到最大最小值
        data_min = min(data(:,i));
        data_max = max(data(:,i));
        % 构建区间边界
        bin_edges = linspace(data_min, data_max, num_bins + 1);
        % 初始化矩阵
        num_labels = size(unique_labels,1);
        result_matrix = zeros(num_labels, num_bins);
        % 对每个 label 进行循环
        for k = 1:num_labels
            % 找到当前 label 在 data 中的索引
            idx = find(data(:,1) == unique_labels(k));
            % 统计当前 label 在每个区间的数量
            label_counts = histcounts(data(idx,i), bin_edges);
            % 将结果存储在结果矩阵中
            result_matrix(k, :) = label_counts;
        end
        row_sums = sum(result_matrix, 2);
        % 将每行的元素除以对应行的总和
        result_matrix = result_matrix ./ row_sums;
        norm_value = norm(result_matrix*result_matrix');
        Cross_entrophy = [Cross_entrophy;norm_value];
    end
end